package lambda;

/**
 * @program: baseModule
 * @description:
 * @author: zhanghz001
 * @create: 2020-10-22 17:52
 **/
public class AddableDemo {
    public static void main(String[] args) {
        useAddable((x, y) -> x + y);
        useAddable(new Addable() {
            @Override
            public int add(int x, int y) {
                return x + y;
            }
        });
    }

    private static void useAddable(Addable addable) {
        System.out.println(addable.add(1, 2));
    }
}
